<?php

use app\common\model\platform\PlatformSetting;
use hiduoke\services\facade\WechatService as Ws;
use think\facade\View;

function getJssdk($debug = false, $jsApiList = [])
{
    return Ws::getJssdk($debug, $jsApiList);
}

function getShare($share = [], $fun = '')
{
    return Ws::getShare($share, $fun);
}

function getWxUser()
{
    return Ws::getUser();
}

function getDomain()
{
    $preference = (new PlatformSetting())->getValueByKey("preference", get_plaid());
    $res = array(
        'oauth' => $preference['oauth_domain'] ?? '',
        'share' => $preference['share_domain'] ?? '',
        'die'   => $preference['die_domain'] ?? '',
    );
    return $res;
}
